import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
// import babel from '@rollup/plugin-babel'

export default defineConfig({
  plugins: [
    uni(),
    // babel({
    //   babelHelpers: 'bundled',
    //   plugins: ['@dcloudio/babel-plugin-uni-app-backend'],
    //   include: [/\.js$/, /\.mjs$/], // 仅对 JS 文件应用此 Babel 插件
    // }),
  ],
  server: {
    proxy: {
		'/api': { 
			target: 'http://192.168.100.205:11024',
			changeOrigin: true,
			// rewrite: (path) => path.replace(/^\/api/, ''),
			secure: false,
			logLevel: 'debug',
		},
		'/imApi': {
			target: 'http://192.168.100.205:8888',
			changeOrigin: true,
			// rewrite: (path) => path.replace(/^\/api/, ''),
			secure: false,
			logLevel: 'debug',
		},
		'/sxjkApi': { //APP免登接口代理
			target: 'http://test.transportech.cn:8082',
			changeOrigin: true,
			// rewrite: (path) => path.replace(/^\/api/, ''),
			// secure: false,
			// logLevel: 'debug',
		},
		// 融合通信视频地址
		'/video-proxy': {
			target: 'http://192.168.100.207:11080',
			changeOrigin: true,
			rewrite: (path) => path.replace(/^\/video-proxy/, '')
		}
    }
  }
  // server: {
  //   proxy: {
  //     '/api': {
  //       target: 'https://19614y05r3.zicp.fun',
  //       changeOrigin: true,
  //       rewrite: (path) => path.replace(/^\/api/, ''),
  //       secure: false,
  //       logLevel: 'debug',
  //     }
  //   }
  // }
})
